﻿using FreeSql.DatabaseModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace DataBase.Main
{

    /// <summary>
    /// 设备信息表
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "t_Device", DisableSyncStructure = true)]
    public partial class TDevice
    {

        /// <summary>
        /// 主键唯一标识Id
        /// </summary>
        [JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
        public long Id { get; set; }

        [JsonProperty, Column(Name = "alarm")]
        public int? Alarm { get; set; }

        /// <summary>
        /// 设备大类
        /// </summary>
        [JsonProperty, Column(Name = "bigTypeId")]
        public long? BigTypeId { get; set; }

        [JsonProperty]
        public long? CityId { get; set; }

        /// <summary>
        /// 数据录入时间
        /// </summary>
        [JsonProperty, Column(Name = "createTime")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [JsonProperty]
        public DateTime? DelTime { get; set; }

        /// <summary>
        /// 删除用户Id
        /// </summary>
        [JsonProperty]
        public long? DelUser { get; set; }

        /// <summary>
        /// 设备Id10进制形式
        /// </summary>
        [JsonProperty, Column(Name = "deviceId")]
        public long? DeviceId { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        [JsonProperty, Column(Name = "deviceName", StringLength = -2)]
        public string DeviceName { get; set; }

        [JsonProperty, Column(Name = "earlyWarn")]
        public int? EarlyWarn { get; set; }

        /// <summary>
        /// 所在供电
        /// </summary>
        [JsonProperty]
        public long? ElectricId { get; set; }

        /// <summary>
        /// 安装日期
        /// </summary>
        [JsonProperty]
        public DateTime? InstallDate { get; set; }

        /// <summary>
        /// 安装人员
        /// </summary>
        [JsonProperty, Column(StringLength = -2)]
        public string Installer { get; set; }

        /// <summary>
        /// 是否已删除
        /// </summary>
        [JsonProperty, Column(Name = "isDel")]
        public bool? IsDel { get; set; } = false;

        /// <summary>
        /// 设备是否故障
        /// </summary>
        [JsonProperty, Column(Name = "isError")]
        public bool? IsError { get; set; }

        /// <summary>
        /// 是否在线
        /// </summary>
        [JsonProperty, Column(Name = "isOnline")]
        public bool? IsOnline { get; set; }

        [JsonProperty]
        public DateTime? LastDataTime { get; set; }

        /// <summary>
        /// 纬度
        /// </summary>
        [JsonProperty, Column(Name = "latitude")]
        public double? Latitude { get; set; }

        /// <summary>
        /// 设备线路Id
        /// </summary>
        [JsonProperty]
        public long? LineId { get; set; }

        /// <summary>
        /// 位置说明
        /// </summary>
        [JsonProperty, Column(Name = "localInstructions", StringLength = -2)]
        public string LocalInstructions { get; set; }

        /// <summary>
        /// 经度
        /// </summary>
        [JsonProperty, Column(Name = "longitude")]
        public double? Longitude { get; set; }

        /// <summary>
        /// 生产厂家
        /// </summary>
        [JsonProperty, Column(Name = "manufacturer", StringLength = -2)]
        public string Manufacturer { get; set; }

        /// <summary>
        /// 树节点路径
        /// </summary>
        [JsonProperty, Column(Name = "nodePath", StringLength = -2)]
        public string NodePath { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        [JsonProperty, Column(Name = "orderNo")]
        public long? OrderNo { get; set; }

        /// <summary>
        /// 所属树形节点Id
        /// </summary>
        [JsonProperty, Column(Name = "parentId")]
        public long? ParentId { get; set; }

        [JsonProperty]
        public long? ProvinceId { get; set; }

        [JsonProperty, Column(Name = "putAlarm")]
        public bool? PutAlarm { get; set; }

        [JsonProperty, Column(Name = "putOperation")]
        public bool? PutOperation { get; set; }

        /// <summary>
        /// SIM卡号
        /// </summary>
        [JsonProperty, Column(Name = "simNo", StringLength = -2)]
        public string SimNo { get; set; }

        /// <summary>
        /// 设备小类
        /// </summary>
        [JsonProperty, Column(Name = "smallTypeId")]
        public long? SmallTypeId { get; set; }

        /// <summary>
        /// 设备唯一标识16进制形式
        /// </summary>
        [JsonProperty, Column(StringLength = -2)]
        public string TerminalId { get; set; }

        [JsonProperty, Column(Name = "valueA", DbType = "decimal(18,2)")]
        public decimal? ValueA { get; set; }

        [JsonProperty, Column(Name = "valueB", DbType = "decimal(18,2)")]
        public decimal? ValueB { get; set; }

        [JsonProperty, Column(Name = "valueC", DbType = "decimal(18,2)")]
        public decimal? ValueC { get; set; }

    }

}
